import 'package:flutter_deer/generated/json/base/json_convert_content.dart';
import 'package:flutter_deer/database/beans/get_merchant_configer.dart';
import 'package:flustars_flutter3/flustars_flutter3.dart';

import 'package:flutter_deer/res/constant.dart';


GetMerchantPreferentialConfigEntity $GetMerchantPreferentialConfigEntityFromJson(Map<String, dynamic> json) {
  final GetMerchantPreferentialConfigEntity getMerchantPreferentialConfigEntity = GetMerchantPreferentialConfigEntity();
  final int? rechargeOtherGiftConfig = jsonConvert.convert<int>(json['rechargeOtherGiftConfig']);
  if (rechargeOtherGiftConfig != null) {
    getMerchantPreferentialConfigEntity.rechargeOtherGiftConfig = rechargeOtherGiftConfig;
  }
  final int? offlineDiscounts = jsonConvert.convert<int>(json['offlineDiscounts']);
  if (offlineDiscounts != null) {
    getMerchantPreferentialConfigEntity.offlineDiscounts = offlineDiscounts;
  }
  final int? roundingMode = jsonConvert.convert<int>(json['roundingMode']);
  if (roundingMode != null) {
    getMerchantPreferentialConfigEntity.roundingMode = roundingMode;
  }
  return getMerchantPreferentialConfigEntity;
}

Map<String, dynamic> $GetMerchantPreferentialConfigEntityToJson(GetMerchantPreferentialConfigEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['rechargeOtherGiftConfig'] = entity.rechargeOtherGiftConfig;
  data['offlineDiscounts'] = entity.offlineDiscounts;
  data['roundingMode'] = entity.roundingMode;
  return data;
}

extension GetMerchantPreferentialConfigEntityExtension on GetMerchantPreferentialConfigEntity {
  GetMerchantPreferentialConfigEntity copyWith({
    int? rechargeOtherGiftConfig,
    int? offlineDiscounts,
    int? roundingMode,
  }) {
    return GetMerchantPreferentialConfigEntity()
      ..rechargeOtherGiftConfig = rechargeOtherGiftConfig ?? this.rechargeOtherGiftConfig
      ..offlineDiscounts = offlineDiscounts ?? this.offlineDiscounts
      ..roundingMode = roundingMode ?? this.roundingMode;
  }
}